//
//  NSString+replaceChar.m
//  Stars
//
//  Created by zhaoml on 2017/12/15.
//  Copyright © 2017年 hst. All rights reserved.
//

#import "NSString+replaceChar.h"

@implementation NSString (replaceChar)

- (NSString *)stringByReplacingOccurrencesOfStringGroups:(NSString *)strGroups withString:(NSString *)newString {
    NSString *returnString = self;
    if ([strGroups isEqualToString:@"file"]) {
        strGroups =@"\"/:*?<>|\\“";
        newString = @"_";
    }
    for (int i=0; i<strGroups.length; i++) {
        NSString *charStr = [strGroups substringWithRange:NSMakeRange(i, 1)];
        returnString =  [returnString stringByReplacingOccurrencesOfString:charStr withString:newString];
    }
    return returnString;
}


@end
